]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Allow passing callback to AppFolderDialog.popdown()
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 24 Sep 2020 19:31:00 +0000 (16:31 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 5 Oct 2020 12:06:48 +0000 (12:06 +0000)
Next commit will allow removing icons from the folder, and we want to
do that effectively after the dialog pops down.

Add an optional callback to AppFolderDialog.popdown().

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1447

js/ui/appDisplay.js

index fa2782d81e56a87a6613410d49d4bdd21dc756f6..43bab2db98e4c9a67038ad320a6d308df9124244 100644 (file)
@@ -2093,6 +2093,8 @@ var AppFolderDialog = GObject.registerClass({
         this._sourceMappedId = 0;
         this._popdownTimeoutId = 0;
         this._needsZoomAndFade = false;
+
+        this._popdownCallbacks = [];
     }
 
     _addFolderNameEntry() {
@@ -2297,6 +2299,9 @@ var AppFolderDialog = GObject.registerClass({
                     opacity: 255,
                 });
                 this.hide();
+
+                this._popdownCallbacks.forEach(func => func());
+                this._popdownCallbacks = [];
             },
         });
 
@@ -2477,7 +2482,16 @@ var AppFolderDialog = GObject.registerClass({
         this.emit('open-state-changed', true);
     }
 
-    popdown() {
+    popdown(callback) {
+        // Either call the callback right away, or wait for the zoom out
+        // animation to finish
+        if (callback) {
+            if (this.visible)
+                this._popdownCallbacks.push(callback);
+            else
+                callback();
+        }
+
         if (!this._isOpen)
             return;